//
//  SFStatusViewCell.swift
//  SFWeiboPro
//
//  Created by happy on 2017/9/21.
//  Copyright © 2017年 happy. All rights reserved.
//

import UIKit

class SFStatusViewCell: UITableViewCell {
    
    
    var viewModel: SFStatusViewModel? {
        didSet {
            
            nameLabel.text = viewModel?.status.user?.screen_name
            
            statusLabel.text = viewModel?.status.text
            
            menberImgView.image = viewModel?.memberImage
            
            vipImgView.image = viewModel?.vipImage
            
            iconImgView .sf_setImage(urlString: viewModel?.status.user?.profile_image_url, placeholderImage: UIImage(named: "avatar_default_big"), isAvtar: true)
            
            statusToolBar.viewModel = viewModel
            
            statusPictureView.heightConstraint.constant = viewModel?.pictureSize?.height ?? 0
            
            statusPictureView.urls = viewModel?.status.pic_urls
//            topPictureCons.constant = 0
        }
        
    }
    

    /// 头像
    @IBOutlet weak var iconImgView: UIImageView!
    
    /// 姓名
    @IBOutlet weak var nameLabel: UILabel!
    
    /// 会员图标
    @IBOutlet weak var menberImgView: UIImageView!
    
    /// 时间
    @IBOutlet weak var timeLabel: UILabel!
    
    /// 来源
    @IBOutlet weak var sourceLabel: UILabel!
    
    /// vip图标
    @IBOutlet weak var vipImgView: UIImageView!
    
    /// 正文
    @IBOutlet weak var statusLabel: UILabel!
    
    /// 底部状态栏
    @IBOutlet weak var statusToolBar: SFStatusToolBar!
    
    /// 图片视图
    @IBOutlet weak var statusPictureView: SFStatusPictureView!
    
    @IBOutlet weak var topPictureCons: NSLayoutConstraint!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

    }

}
